package com.wordlearning.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("words")
public class Word {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("content")
    private String content;

    private String translation;
    private String pronunciation;
    private String partOfSpeech;
    private String exampleSentence;
    private String definition;
    private String language = "en";

    @TableField("created_at")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    private LocalDateTime updatedAt;
    
    // MyBatis-Plus自动填充功能，通过MyMetaObjectHandler实现
    // 不需要手动实现@PrePersist和@PreUpdate方法
}